//
//  FinishedViewController.m
//  PersonnelWashCar
//
//  Created by 张越 on 16/5/5.
//  Copyright © 2016年 张越. All rights reserved.
//

#import "FinishedViewController.h"
#import "HomePageController.h"
#import "NoFinishDetailController.h"


@interface FinishedViewController ()<UITabBarDelegate,UITabBarControllerDelegate>
@property (strong, nonatomic) IBOutlet UIButton *grabOrderBtn; // 抢单按钮
@property (strong, nonatomic) IBOutlet UIButton *doOrderBtn; // 执行订单按钮

@end

@implementation FinishedViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    if ([self.finshedVCStr isEqualToString:@"抢单成功"]) {
        self.title = @"抢单成功";
    } else {
        self.title = @"订单完成";
    }
    self.grabOrderBtn.layer.cornerRadius = self.doOrderBtn.layer.cornerRadius = 10.0f;
    self.grabOrderBtn.layer.masksToBounds = self.doOrderBtn.layer.masksToBounds = YES;
    [self addLeftButtonWithImage:[UIImage imageNamed:@""] actionBlock:nil];
}

// 抢单按钮
- (IBAction)grabOrderBtnAction:(UIButton *)sender {
    [self.navigationController popToRootViewControllerAnimated:YES];
    [[NSNotificationCenter defaultCenter] postNotificationName:@"LoadTableView" object:nil];
}

// 执行订单按钮
- (IBAction)doOrderBtnAction:(UIButton *)sender {
    NoFinishDetailController *orderVC = [[NoFinishDetailController alloc]init];
    orderVC.orderSN = self.orderSN;
    orderVC.hidesBottomBarWhenPushed = YES;
    orderVC.fromStr = @"待完成";
    orderVC.fromWhereStr = @"抢单成功";
    [self.navigationController pushViewController:orderVC animated:YES];
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
